var obj = {
    value : 100
}

Object.defineProperty(obj,'value',{
    value : 10,
    writable : true,
    enumerable : true
})

console.log('initval value',obj.value)

class TessClass {
    constructor() {
        this.value = '101';
    }
    set setNewVal(val) {
        this.value = val
    }
    get getVal() {
        return this.value = val
    }
}
var test = new TessClass()
console.log(test.value,'第二个输出')
test.setNewVal = 1
console.log(test.value)